package task;

import com.hmall.item.service.impl.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * TODO
 *
 * @Author mr.ma
 * @Date 2024/11/22 10:59
 */
@Component
@EnableScheduling
public class ItemTask {

    @Autowired
    private ItemService itemService;

    @Scheduled(cron = "0 0 3 * *?")
    public void scheduleTask(){
        itemService.getTop20();
    }
}
